package com.slz3.business.module.goodsManagement.gooGoods.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooGoods.domain.GooGoods;
import com.slz3.business.module.goodsManagement.gooGoods.domain.GooGoodsCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;
@Component
public class GooGoodsResAtomic {

    public Mono<ServerResponse> add_$GooGoodsUpdateLock(ServerRequest req, GooGoods gooGoods) {
        return GooGoodsResSafeValid.add(req, gooGoods) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.add(req, gooGoods);
    }

    public  Mono<ServerResponse> delete_$GooGoodsUpdateLock(ServerRequest req, GooGoodsCondition gooGoodsCondition) {
        return GooGoodsResSafeValid.delete(req, gooGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$GooGoodsUpdateLock(ServerRequest req, GooGoods gooGoods) {
        return GooGoodsResSafeValid.modify(req, gooGoods) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.modify(req, gooGoods);
    }

    public Mono<ServerResponse> info_$GooGoodsUpdateLock(ServerRequest req) {
        return GooGoodsResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.info(req);
    }

    public  Mono<ServerResponse> auditSubmit_$GooGoodsUpdateLock(ServerRequest req, GooGoodsCondition gooGoodsCondition) {
        return GooGoodsResSafeValid.auditSubmit(req, gooGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.auditSubmit(req);
    }

    public  Mono<ServerResponse> audit_$GooGoodsUpdateLock(ServerRequest req, GooGoodsCondition gooGoodsCondition) {
        return GooGoodsResSafeValid.audit(req, gooGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.audit(req);
    }

    public  Mono<ServerResponse> auditReject_$GooGoodsUpdateLock(ServerRequest req, GooGoodsCondition gooGoodsCondition) {
        return GooGoodsResSafeValid.auditReject(req, gooGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$GooGoodsUpdateLock(ServerRequest req, GooGoodsCondition gooGoodsCondition) {
        return GooGoodsResSafeValid.usingEnable(req, gooGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.usingEnable(req);
    }

    public  Mono<ServerResponse> usingDisable_$GooGoodsUpdateLock(ServerRequest req, GooGoodsCondition gooGoodsCondition) {
        return GooGoodsResSafeValid.usingDisable(req, gooGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooGoodsResExecutor.usingDisable(req);
    }
}
